package com.example.exception;

import com.example.enums.CodeEnum;

/**
 * @author edehhjn 
 * 自定义异常类 spring 必须是RuntimeException才会有回滚
 */
public class CommonException extends RuntimeException {
	
	private Integer code;

	public CommonException(CodeEnum codeenum) {
		super(codeenum.getMsg());
		this.code = codeenum.getCode();
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

}
